<?php
$filename = $_GET['f'];
if(empty($filename)){exit('-1');}
$path = '/data/cloud/logs/'.$filename;
$fp = fopen($path,'r');
Header("Content-type: application/octet-stream");
Header("Accept-Ranges: bytes");
Header("Accept-Length: ".filesize($path));
Header("Content-Disposition: attachment; filename=".$filename);
// 输出文件内容
echo fread($fp,filesize($path));
fclose($fp);
exit();
?>